import request from '@/config/axios'

export interface PublicityNoticeVO {
  id: number
  classify: string
  content: string
  keyValue: string
  state: number
}

// 查询通用公示列表
export const getPublicityNoticePage = async (params) => {
  return await request.get({ url: `/general/publicity-notice/page`, params })
}

export const getCommonList = async (params) => {
  return await request.get({ url: `/general/publicity-notice/commonList?classify=`+params })
}

// 查询通用公示详情
export const getPublicityNotice = async (id: number) => {
  return await request.get({ url: `/general/publicity-notice/get?id=` + id })
}

// 新增通用公示
export const createPublicityNotice = async (data: PublicityNoticeVO) => {
  return await request.post({ url: `/general/publicity-notice/create`, data })
}

// 修改通用公示
export const updatePublicityNotice = async (data: PublicityNoticeVO) => {
  return await request.put({ url: `/general/publicity-notice/update`, data })
}

// 删除通用公示
export const deletePublicityNotice = async (id: number) => {
  return await request.delete({ url: `/general/publicity-notice/delete?id=` + id })
}

// 导出通用公示 Excel
export const exportPublicityNotice = async (params) => {
  return await request.download({ url: `/general/publicity-notice/export-excel`, params })
}
